/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.mapbar.pay.action;
import com.mapbar.pay.entity.Device;
import com.mapbar.pay.entity.User;
import com.mapbar.pay.service.DeviceService;
import com.mapbar.pay.service.UserService;
import org.apache.log4j.Logger;
/**
 * 购买流程的信息确认
 *创建时间 2010-3-9 17:22:08
 * @author fengbj
 */
public class BuyConfirmInfoAction extends BaseAction{

    private Logger logger = Logger.getLogger(this.getClass()); //日志对象
    private Device device;
    private DeviceService deviceService;
    private UserService userService;

    @Override
    public String execute() throws Exception {
        if(getUser() != null){
            User user = getUser();
            userService.refreshUserInfo(user);

            device = deviceService.getDeviceInfo(user.getSerial());
            logger.info("用户[" + user + "],设备信息[" + device + "]");

            
            //
            user = null;

            return SUCCESS;
        }else{
            return "buyLogon";
        }
    }

    public void setDeviceService(DeviceService deviceService) {
        this.deviceService = deviceService;
    }

    public Device getDevice() {
        return device;
    }

    public void setUserService(UserService userService) {
        this.userService = userService;
    }




}
